using zhwy.saas.api.Entity.Sys;

namespace zhwy.saas.api.Services.Sinterface.Sys
{
    /// <summary>
    /// 系统权限服务接口
    /// </summary>
    public interface ISysPermissionService : IBaseService<PermissionsEntity>
    {
        /// <summary>
        /// 获取角色的所有权限
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <returns>权限列表</returns>
        Task<List<PermissionsEntity>> GetPermissionsByRoleIdAsync(long roleId);

        /// <summary>
        /// 获取用户的所有权限
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>权限列表</returns>
        Task<List<PermissionsEntity>> GetPermissionsByUserIdAsync(long userId);

        /// <summary>
        /// 获取权限编码的所有权限
        /// </summary>
        /// <param name="permcodes">权限编码</param>
        /// <returns>权限列表</returns>
        Task<List<PermissionsEntity>> GetPermissionsByPermcodesAsync(List<string> permcodes);

        /// <summary>
        /// 批量保存权限
        /// </summary>
        /// <param name="permissions">权限列表</param>
        /// <returns>是否保存成功</returns>
        Task<bool> SavePermissionsAsync(List<PermissionsEntity> permissions);
    }
}